<% session[:ret_post] = request.request_uri %>
<% session[:post_id] = params[:id] %>
<h1><% if !(@post.category.parent_id.nil?) %>/<%= link_to( get_category_name(@post.category.parent_id), show_category_posts_path(@post.category.parent_id) ) %><% end %>/<%= link_to( get_category_name(@post.category_id), show_category_posts_path(@post.category_id) ) %></h1>

<%= link_to("Back", show_category_posts_path(@post.category_id), {:class => "button", :style => " float: right "}) %>
<%= link_to("Reply", "/posts/reply/#{@post.id}", :class => "button") %>

<%= render :partial =>  "posts/show_post", :locals => { :post => @post } %>

<div id="replies">
  <% @posts.each do |p| %>
  <%= render :partial =>  "posts/show_post", :locals => { :post => p } %>
  <% end %>
</div>
<div style="clear: both;"></div>
<%= link_to("Reply", "/posts/reply/#{@post.id}", :class => "button" ) %>